<!DOCTYPE html>
<html>
<head>
	<title><#:C('sitename')#>-管理平台</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	 <include file="Pub:style"/>
    <!-- libraries -->
    <link href="<#$Theme['P']['root']#>/bootadmin/css/lib/uniform.default.css" type="text/css" rel="stylesheet" />
    <link href="<#$Theme['P']['root']#>/bootadmin/css/lib/select2.css" type="text/css" rel="stylesheet" />
   	 <link rel="stylesheet" href="<#$Theme['P']['root']#>/bootadmin/css/compiled/form-showcase.css" type="text/css" media="screen" />
<body>


<include file="Pub:Nav"/>
   <include file="Pub:Sidebar"/>


	<!-- main container -->
    <div class="content">
    	 <div class="container-fluid">
            <div id="pad-wrapper" class="form-page">
            	
                <div class="row-fluid form-wrapper">
                 		<div class="span12">
                            <h4>修改密码</h4>
                        </div>
                    <!-- left column -->
                    <div class="span8 column">
                        <form name="">
                        <div class="alert span9" style="display: none;">
						  <span id="alertmsg"></span>
						</div>
                              <div class="field-box">
                                <label>旧密码:</label>
                                <input class="span8" type="password" name="oldpwd" id="oldpwd" value="<#$info.money#>" data-toggle="tooltip" data-trigger="focus" title="4-20个字符 ，数字,字母或下划线组成" data-placement="right" />
                            </div>
                             <div class="field-box">
                                <label>新密码:</label>
                                <input class="span8" type="password" name="password" id="password" value="<#$info.money#>" data-toggle="tooltip" data-trigger="focus" title="4-20个字符 ，数字,字母或下划线组成" data-placement="right" />
                            </div>
							 <div class="field-box">
                                <label>重复新密码:</label>
                                <input class="span8" type="password" name="password2" id="password2" value="<#$info.money#>" data-toggle="tooltip" data-trigger="focus" title="4-20个字符 ，数字,字母或下划线组成" data-placement="right" />
                            </div>
                              <div class="field-box ">
                              <input type="hidden" name="sid" id="sid" value="<#$info.id#>">
                                <input type="button"   class="btn-glow primary "  id="btn_save" value="修改密码">

                            </div>
                        </form>
                    </div>

                    <!-- right column -->
                    <div class="span4 column pull-right">

                    </div>
                </div>
            </div>
        </div>
    </div>

	<div class="modal  hide fade" id="myModal">
	  <div class="modal-header">
	    <a class="close" data-dismiss="modal">×</a>
	    <h3>提示信息</h3>
	  </div>
	  <div class="modal-body">
	    <p>内容</p>
	  </div>
	  <div class="modal-footer">
	    <a href="#" class="btn"  data-dismiss="modal">关闭</a>
	  </div>
	</div>
	<!-- scripts -->
    <script src="<#$Theme['P']['js']#>/jquery.js"></script>
    <script src="<#$Theme['P']['root']#>/bootadmin/js/bootstrap.min.js"></script>
    <script src="<#$Theme['P']['root']#>/bootadmin/js/theme.js"></script>

   <script src="<#$Theme['P']['root']#>/bootadmin/js/common.js"></script>
          
<!-- call this page plugins -->
    <script type="text/javascript">
    	
    	 
        $(function () {
        	
            // add uniform plugin styles to html elements
           
            
            //$(".alert").alert('close');
			$('#btn_save').bind('click',function(){

				var s=$('#oldpwd').val();
				var link=$('#password').val();
				var link2=$('#password2').val();
				

				  if (s == "") {
					  AlertTips("旧密码不能为空",1500);
					
				      return false;
				  }
				  if (link == "") {
					  
					  AlertTips("新密码不能为空",1500);
				        return false;
				  }
				if (link2 == "") {
					  
					  AlertTips("重复新密码不能为空",1500);
				        return false;
				  }
				  if(link != link2){
					 AlertTips("两次新密码输入不一致",1500);
				        return false;
				  }
				  $.ajax({
					  	url: '<#:U('pwd')#>',
				        type: "post",
						data:{
							'oldpwd':s,
							'password':link,
							'__hash__':$('input[name="__hash__"]').val()
							},
						dataType:'json',
						error:function(){
			
								AlertTips("服务器忙，请稍候再试",1500);
								},
						success:function(data){
								if(data.error==0){
									$('#oldpwd').val('');
									$('#password').val('');
									$(".modal-body").html("<p>保存成功</p>");
									$('#myModal').modal('show');
								}else{
									AlertTips(data.msg,1500);
								}
						}
					  });
				});
            
        });
    </script>
</body>
</html>